home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Medabots Cardz
/
Medabots CD Cardz Rokusho.bin
/
pc
/
assets
/
rokusho.dxr
/
00008_Script_8
< prev
next >
Wrap
Text File
|
2001-12-07
|
2KB
|
65 lines
property pSpeed, dx, dy
property mysprite
global discx, discy, area, smallmedal, portdy, portdx, goback
on beginsprite me
set mysprite to the spritenum of me
set the blend of sprite mysprite = 100
set dx to the loch of sprite(mysprite)
set dy to the locv of sprite(mysprite)
end
on mouseUp me
if sprite mysprite intersects sprite(11) then
set the blend of sprite mysprite = 0
set the loch of sprite mysprite to dx
set the locv of sprite mysprite to dy
smallmedal = 1
area = 1
else
set the loch of sprite mysprite to dx
set the locv of sprite mysprite to dy
end if
end
on exitframe
if area = 0 then
sprite(mysprite).moveablesprite = TRUE
else
sprite(mysprite).moveablesprite = FALSE
end if
if goback = 1 then
set the blend of sprite mysprite = 100
goback = 0
end if
if sprite mysprite intersects sprite(11) then
-- set the width of sprite(mysprite) to 38
-- set the height of sprite(mysprite) to 40
else
-- set the width of sprite(mysprite) to 66
-- set the height of sprite(mysprite) to 77
end if
end
-- move character
on move me, dx, dy
-- get current loc
loc = sprite(me.spriteNum).loc
-- move loc and rect
global pSpeed
loc = loc + point(dx,dy)*pSpeed
rect = rect + rect(dx*pSpeed,dy*pSpeed,dx*pSpeed,dy*pSpeed)
-- safety check to make sure character stays on screen
if rect.left < 0 then exit
if rect.top < 0 then exit
if rect.right > (the stage).rect.width then exit
if rect.bottom > (the stage).rect.height then exit
-- set new character location
sprite(me.spriteNum).loc = loc
end